package com.qfedu.scode.controller;

import com.qfedu.scode.config.SystemConfig;
import com.qfedu.scode.entity.Projectconfig;
import com.qfedu.scode.service.intf.ProjectconfigService;
import com.qfedu.scode.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @program: StartCoding
 * @description: 一款真正的后端源码生成器，助力轻松入门Java程序
 * @author: Feri(老邢)
 * @create: 2021-01-06 11:09:45
 */
@RestController
@RequestMapping("api/projectconfig/")
@Api(tags = "实现Projectconfig各种操作")
public class ProjectconfigController{
    /*
    *注入业务逻辑层对象*/
    @Autowired
    private ProjectconfigService service;
    /*
    * 新增内容*/
    @ApiOperation(value = "实现项目的生成",notes = "实现项目的生成")
    @PostMapping("createproject.do")
    public R save(@RequestBody Projectconfig projectconfig, HttpServletRequest request){
       return service.createProject(request.getHeader(SystemConfig.TOKEN_HEADER),projectconfig);
    }
    /*
    * 查询 所有数据*/
    @ApiOperation(value = "实现全部查询",notes = "实现全部查询")
    @GetMapping("all.do")
    public R all(){
       return service.queryAll();
    }


}